import * as sqlite_opt from "@/utils/sqliteUtil.js";

const visualListTableName = "t_code_wrk_cls";

export const requireWrkClsDataByCode = (inCode) => {
	return new Promise((resolve, reject) => {
		let sqlStr = `SELECT * `;
		sqlStr += `from ` + visualListTableName + ` where code = ` + inCode ;

		sqlite_opt.selectSql(sqlStr,
			(e) => {
				resolve(e);
			},
			(e) => {
				console.log(e)
				reject(e);
			});
	})
}

export const requireAllWrkClsList = () => {
	return new Promise((resolve, reject) => {
		let sqlStr = `SELECT * `;
		sqlStr += `from ` + visualListTableName + ` order by cod_ordr`;

		sqlite_opt.selectSql(sqlStr,
			(e) => {
				resolve(e);
			},
			(e) => {
				console.log(e)
				reject(e);
			});
	})
}
